package cn.com.klun.tjy.common.basePojo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public abstract class AbstractBaseController {
    private Logger logger = LoggerFactory.getLogger("AbstractBaseController");

    public AbstractBaseController() {
    }

    protected boolean ajax(HttpServletResponse response, String content, String type) {
        try {
            response.setContentType(type + ";charset=UTF-8");
            response.setHeader("Pragma", "No-cache");
            response.setHeader("Cache-Control", "no-cache");
            response.setDateHeader("Expires", 0L);
            response.getWriter().write(content);
            response.getWriter().flush();
            return true;
        } catch (IOException var5) {
            this.logger.error("后台管理的控制器的抽象基础父类 ，信息回写失败", var5);
            return false;
        }
    }
}